<!DOCTYPE html>
<html lang="en-gb" dir="ltr">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>项目结构 - UIkit 中文文档</title>
        <meta name="description" content="深入挖掘UIkit的核心部分，了解关于它的一切。">
        <meta name="author" content="UIkit中文网">
         
<meta name="keywords" content="UIkit核心部分,UIkit项目结构,UIKit文件结构,测试UIKit,UIKit高级用法,自动化预处理,安装Node,设置Gulp">
        <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
        <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png">
        <link id="data-uikit-theme" rel="stylesheet" href="css/uikit.docs.min.css">
        <link rel="stylesheet" href="css/docs.css">
        <link rel="stylesheet" href="../vendor/highlight/highlight.css">
        <script src="../vendor/jquery.js"></script>
        <script src="js/uikit.min.js"></script>
        <script src="../vendor/highlight/highlight.js"></script>
        <script src="js/docs.js"></script>
    </head>

    <body class="tm-background">

        <nav class="tm-navbar uk-navbar uk-navbar-attached">
            <div class="uk-container uk-container-center">

                <a class="uk-navbar-brand uk-hidden-small" href="../index.html"><img class="uk-margin uk-margin-remove" src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></a>

                <ul class="uk-navbar-nav uk-hidden-small">
                    <li class="uk-active"><a href="documentation_get-started.html">开始使用</a></li>
                    <li><a href="core.html">核心组件</a></li>
                    <li><a href="components.html">附加组件</a></li>
                    <li><a href="customizer.html">定制工具</a></li>
                    <li><a href="../showcases/index.html">案例展示</a></li>
                    <li><a href="about.html" target="_blank">关于我们</a></li>
                </ul>

                <a href="#tm-offcanvas" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas></a>

                <div class="uk-navbar-brand uk-navbar-center uk-visible-small"><img src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></div>

            </div>
        </nav>

        <div class="tm-middle">
            <div class="uk-container uk-container-center">

                <div class="uk-grid" data-uk-grid-margin>
                    <div class="tm-sidebar uk-width-medium-1-4 uk-hidden-small">

                        <ul class="tm-nav uk-nav" data-uk-nav>

                            <li class="uk-nav-header">初学者</li>
                            <li><a href="documentation_get-started.html">开始使用</a></li>
                            <li><a href="documentation_how-to-customize.html">如何自定义</a></li>
                            <li><a href="documentation_layouts.html">布局示例</a></li>
                            <li class="uk-nav-header">开发者</li>
                            <li class="uk-active"><a href="documentation_project-structure.html">项目结构</a></li>
                            <li><a href="documentation_less-sass.html">Less &amp; Sass 文件</a></li>
                            <li><a href="documentation_create-a-theme.html">创建主题</a></li>
                            <li><a href="documentation_create-a-style.html">创建样式</a></li>
                            <li><a href="documentation_customizer-json.html">Customizer.json</a></li>
                            <li><a href="documentation_javascript.html">JavaScript</a></li>
                            <li><a href="documentation_custom-prefix.html">自定义前缀</a></li>

                        </ul>

                    </div>
                    <div class="tm-main uk-width-medium-3-4">

                        <article class="uk-article">

                            <h1>项目结构</h1>

                            <p class="uk-article-lead">深入挖掘UIkit的核心，了解关于它的一切。</p>

                            <h2 id="github"><a href="#github" class="uk-link-reset">GitHub</a></h2>

                            <p>UIkit被托管在 <a href="https://github.com/uikit/uikit" target="_blank" rel="nofollow">GitHub</a> 上，基于 <a href="http://opensource.org/licenses/MIT" target="_blank" rel="nofollow">MIT 许可协议</a>。 欢迎使用它应用于个人或商业项目。想要获取 UIKit 所有的源文件，只需克隆 <a href="https://github.com/uikit/uikit" target="_blank" rel="nofollow">GitHub</a> 上的资源库，或者直接下载最新的版本。</p>

                            <p><a class="uk-button uk-button-large uk-button-primary" href="https://github.com/uikit/uikit/archive/master.zip">下载源代码</a></p>

                            <hr class="uk-article-divider">

                            <h2 id="file-structure"><a href="#file-structure" class="uk-link-reset">文件结构</a></h2>

                            <p>UIkit 基于<a href="http://www.lesscss.net/" target="_blank" rel="nofollow">LESS</a>创建，LESS是一款CSS预处理器，将 CSS 赋予了动态语言的特性，如变量，继承，运算，函数等。它将写入LESS中的代码编译成为CSS。它将写在Less里的代码编译成CSS。UIkit主要的文件结构如下： </p>

                            <div class="uk-overflow-container">
                                <table class="uk-table uk-table-striped uk-text-nowrap">
                                    <thead>
                                        <tr>
                                            <th>文件夹</th>
                                            <th>描述</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td><code>/docs</code></td>
                                            <td>包含你正在看的UIkit文档的绝大多数文件</td>
                                        </tr>
                                        <tr>
                                            <td><code>/src</code></td>
                                            <td>包含全部Less和JavaScript组件文件</td>
                                        </tr>
                                        <tr>
                                            <td><code>/tests</code></td>
                                            <td>包含所有组件的测试文件</td>
                                        </tr>
                                        <tr>
                                            <td><code>/themes</code></td>
                                            <td>在子文件夹中包含的所有额外提供的主题文件。</td>
                                        </tr>
                                        <tr>
                                            <td><code>/vendor</code></td>
                                            <td>包含UIkit所使用的jQuery和其他的外部库。</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>

                            <p>所有编译版和压缩版CSS文件、JS文件，以及Less和Sass文件都能在独立的 <a href="https://github.com/uikit/bower-uikit" rel="nofollow">Bower UIkit repository</a> 项目中找到。查看 <a href="documentation_less-sass.html">Less 和 Sass 文件</a> 获取更多信息。</p>

                            <hr class="uk-article-divider">

                            <h2 id="automate-preprocessing"><a href="#automate-preprocessing" class="uk-link-reset">自动地预处理</a></h2>

                            <p>为了自动化处理Less文件编译成为CSS的过程，我们使用 <a href="http://gulpjs.com/"  rel="nofollow">Gulp</a>，一款基于 <a href="http://nodejs.org/"  rel="nofollow">Node.js</a> 的前端构建工具，它监控你的工作目录。无论何时，只要你保存了有修改行为的源文件，Gulp都会自动地将所有文件编译成独立的CSS文件。</p>

                            <p>首先，你需要安装Node，并设置 <code>gulp</code> 作为一个全局的安装。最后，切换到UIkit目录，安装Node依赖模块（Node dependencies）。</p>

<pre><code>npm install -g gulp

cd uikit
npm install</code></pre>

                            <p>现在，你可以运行Gulp来创建和修改版本。UIkit的内置版本被放在 <code>/dist</code> 目录中。通过主题名称参数来只创建一个指定的主题。</p>

<pre><code>gulp [-t themename]</code></pre>

                            <p>你也可以设置Gulp监控你的工作目录，这样它便能在你每次保存时，自动地编译文件。通过主题名称参数来监控一个指定的主题以提升建设进度。</p>

<pre><code>gulp watch [-t themename]</code></pre>

                            <p>加载新的主题和样式到定制工具中。</p>

<pre><code>gulp indexthemes</code></pre>

                            <hr class="uk-article-divider">

                            <h2 id="tests"><a href="#tests" class="uk-link-reset">测试</a></h2>

                            <p>UIkit为每个组件提供测试文件。其中每个页面都包含了组件的测试示例，并为你提供了一个关于盒模型所支持的所有可能性的总览。</p>


                            <p>UIkit 使用 <a href="http://www.browsersync.io/"  rel="nofollow">BrowserSync</a> 加速你的工作流程。运行 <code>gulp sync</code> ，你就能在制作自己的主题或者修改现有主题时，即时地查看改动，这不只是在浏览器中，还支持跨设备。你能在测试中切换所有的组件和主题，甚至切换到RTL模式（从右到左）</p>

                            <p><a class="uk-button uk-button-large uk-button-primary" href="../tests/overview.html">前往测试</a></p>

                        </article>

                    </div>
                </div>

            </div>
        </div>

        <div class="tm-footer">
            <div class="uk-container uk-container-center uk-text-center">

                <ul class="uk-subnav uk-subnav-line uk-flex-center">
                    <li><a href="http://github.com/uikit/uikit" rel="nofollow">GitHub</a></li>
                    <li><a href="http://github.com/uikit/uikit/issues" rel="nofollow">反馈</a></li>
                    <li><a href="http://github.com/uikit/uikit/blob/master/CHANGELOG.md" rel="nofollow">更新日志</a></li>
                    <li><a href="https://twitter.com/getuikit" rel="nofollow">官方Twitter</a></li>
                    <li><a href="http://weibo.com/getuikit" rel="nofollow">中文微博</a></li>
                     
                </ul>

                <div class="uk-panel">
                    <p>Made by <a href="http://www.yootheme.com" rel="nofollow">YOOtheme</a> with love and caffeine.<br class="uk-hidden-small">Licensed under <a href="http://opensource.org/licenses/MIT" rel="nofollow">MIT license</a>.<br>由<a href="http://www.getuikit.net/">UIkit中文网</a>翻译</p>
                    <a href="index.html"><img src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></a>
                </div>

            </div>
        </div>

        <div id="tm-offcanvas" class="uk-offcanvas">

            <div class="uk-offcanvas-bar">

                <ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav="{multiple:true}">
                    <li class="uk-parent"><a href="#">UIkit 中文文档</a>
                        <ul class="uk-nav-sub">
                            <li><a href="documentation_get-started.html">开始使用</a></li>
                            <li><a href="documentation_how-to-customize.html">如何定制</a></li>
                            <li><a href="documentation_layouts.html">布局示例</a></li>
                            <li><a href="core.html">核心组件</a></li>
                            <li><a href="components.html">附加组件</a></li>
                            <li><a href="documentation_project-structure.html">项目结构</a></li>
                            <li><a href="documentation_less-sass.html">Less &amp; Sass 文件</a></li>
                            <li><a href="documentation_create-a-theme.html">创建主题</a></li>
                            <li><a href="documentation_create-a-style.html">创建样式</a></li>
                            <li><a href="documentation_customizer-json.html">Customizer.json</a></li>
                            <li><a href="documentation_javascript.html">JavaScript</a></li>
                            <li><a href="documentation_custom-prefix.html">自定义前缀</a></li>
                        </ul>
                    </li>
                    <li class="uk-nav-header">Core</li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-wrench"></i> 默认</a>
                        <ul class="uk-nav-sub">
                            <li><a href="base.html">基础</a></li>
                            <li><a href="print.html">打印</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-th-large"></i> 布局类组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="grid.html">网格</a></li>
                            <li><a href="panel.html">面板</a></li>
                            <li><a href="block.html">块</a></li>
                            <li><a href="article.html">文章</a></li>
                            <li><a href="comment.html">评论</a></li>
                            <li><a href="utility.html">效果</a></li>
                            <li><a href="flex.html">Flex</a></li>
                            <li><a href="cover.html">覆盖</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-bars"></i> 导航类组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="nav.html">导航菜单</a></li>
                            <li><a href="navbar.html">导航栏</a></li>
                            <li><a href="subnav.html">二级导航</a></li>
                            <li><a href="breadcrumb.html">面包屑</a></li>
                            <li><a href="pagination.html">分页</a></li>
                            <li><a href="tab.html">选项卡</a></li>
                            <li><a href="thumbnav.html">缩略图导航</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-check"></i> 页面元素</a>
                        <ul class="uk-nav-sub">
                            <li><a href="list.html">列表</a></li>
                            <li><a href="description-list.html">描述列表</a></li>
                            <li><a href="table.html">表格</a></li>
                            <li><a href="form.html">表单</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-folder-open"></i> 常用组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="button.html">按钮</a></li>
                            <li><a href="icon.html">图标</a></li>
                            <li><a href="close.html">关闭</a></li>
                            <li><a href="badge.html">徽章</a></li>
                            <li><a href="alert.html">提示框</a></li>
                            <li><a href="thumbnail.html">缩略图</a></li>
                            <li><a href="overlay.html">遮罩</a></li>
                            <li><a href="text.html">文本</a></li>
                            <li><a href="column.html">列</a></li>
                            <li><a href="animation.html">动画</a></li>
                            <li><a href="contrast.html">对比度</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-magic"></i> JavaScript组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="dropdown.html">下拉菜单</a></li>
                            <li><a href="modal.html">模态对话框</a></li>
                            <li><a href="offcanvas.html">抽屉</a></li>
                            <li><a href="switcher.html">切换器</a></li>
                            <li><a href="toggle.html">拨动</a></li>
                            <li><a href="scrollspy.html">滚动监听</a></li>
                            <li><a href="smooth-scroll.html">平滑滚动</a></li>
                        </ul>
                    </li>
                    <li class="uk-nav-header">附加组件</li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-th-large"></i> 布局类组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="grid-js.html">动态网格</a></li>
                            <li><a href="grid-parallax.html">视差网格</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-bars"></i> 导航类组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="dotnav.html">圆点导航</a></li>
                            <li><a href="slidenav.html">滑动导航</a></li>
                            <li><a href="pagination-js.html">动态分页</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-folder-open"></i> 常用组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="form-advanced.html">高级表单</a></li>
                            <li><a href="form-file.html">文件表单</a></li>
                            <li><a href="form-password.html">密码表单</a></li>
                            <li><a href="form-select.html">选择表单</a></li>
                            <li><a href="placeholder.html">占位符</a></li>
                            <li><a href="progress.html">进度条</a></li>
                        </ul>
                    </li>
                    <li class="uk-parent"><a href="#"><i class="uk-icon-magic"></i> JavaScript组件</a>
                        <ul class="uk-nav-sub">
                            <li><a href="lightbox.html">灯箱</a></li>
                            <li><a href="autocomplete.html">自动完成</a></li>
                            <li><a href="datepicker.html">日期选择器</a></li>
                            <li><a href="htmleditor.html">HTML 编辑器</a></li>
                            <li><a href="slider.html">滚动条</a></li>
                            <li><a href="slideset.html">滑块集</a></li>
                            <li><a href="slideshow.html">幻灯片</a></li>
                            <li><a href="parallax.html">视差</a></li>
                            <li><a href="accordion.html">手风琴</a></li>
                            <li><a href="notify.html">通知</a></li>
                            <li><a href="search.html">搜索</a></li>
                            <li><a href="nestable.html">可嵌套</a></li>
                            <li><a href="sortable.html">可排序</a></li>
                            <li><a href="sticky.html">附着</a></li>
                            <li><a href="timepicker.html">时间选择器</a></li>
                            <li><a href="tooltip.html">工具提示</a></li>
                            <li><a href="upload.html">上传</a></li>
                        </ul>
                    </li>
                    <li class="uk-nav-divider"></li>
                    <li><a href="../showcase/index.html">案例展示</a></li>
                    <li><a href="tutorials.html">视频教程</a></li>
                </ul>

            </div>

        </div>
    </body>
</html>
